<template>
    <el-tag type="info">{{ gameData.id }} ) {{ gameData.name }}</el-tag>
</template>

<script>
    export default {
        props: ['id'],
        data () {
            return {};
        },
        watch: {},
        computed: {
            goodsModifyTypes () {
                return this.$store.state.goodsModifyTypes.goodsModifyTypes3;
            },
            gameData() {
                let data = {
                    id: this.id || '-',
                    name: this.name || '-',
                };
                for (let i in this.goodsModifyTypes) {
                    if (this.goodsModifyTypes[i].id === this.id) {
                        data = this.goodsModifyTypes[i];
                        break;
                    }
                }
                return data;
            },
        },
        methods: {
            getAll() {
                if (!this.goodsModifyTypes.length) this.$store.dispatch('goodsModifyTypes/GetAll', 'goodsModifyTypes3');
            },
        },
        created() {
            this.getAll();
        }
    }
</script>

<style scoped>

</style>
